Optimal. Leaf size=161 \[ \frac {\left (a^2+b^2\right )^2 (a+b \tan (c+d x))^{1+n}}{b^5 d (1+n)}-\frac {4 a \left (a^2+b^2\right ) (a+b \tan (c+d x))^{2+n}}{b^5 d (2+n)}+\frac {2 \left (3 a^2+b^2\right ) (a+b \tan (c+d x))^{3+n}}{b^5 d (3+n)}-\frac {4 a (a+b \tan (c+d x))^{4+n}}{b^5 d (4+n)}+\frac {(a+b \tan (c+d x))^{5+n}}{b^5 d (5+n)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 161, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3587, 711}
\begin {gather*} \frac {\left (a^2+b^2\right )^2 (a+b \tan (c+d x))^{n+1}}{b^5 d (n+1)}-\frac {4 a \left (a^2+b^2\right ) (a+b \tan (c+d x))^{n+2}}{b^5 d (n+2)}+\frac {2 \left (3 a^2+b^2\right ) (a+b \tan (c+d x))^{n+3}}{b^5 d (n+3)}-\frac {4 a (a+b \tan (c+d x))^{n+4}}{b^5 d (n+4)}+\frac {(a+b \tan (c+d x))^{n+5}}{b^5 d (n+5)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 711
Rule 3587
Rubi steps
\begin {align*} \int \sec ^6(c+d x) (a+b \tan (c+d x))^n \, dx &=\frac {\text {Subst}\left (\int (a+x)^n \left (1+\frac {x^2}{b^2}\right )^2 \, dx,x,b \tan (c+d x)\right )}{b d}\\ &=\frac {\text {Subst}\left (\int \left (\frac {\left (a^2+b^2\right )^2 (a+x)^n}{b^4}-\frac {4 a \left (a^2+b^2\right ) (a+x)^{1+n}}{b^4}+\frac {2 \left (3 a^2+b^2\right ) (a+x)^{2+n}}{b^4}-\frac {4 a (a+x)^{3+n}}{b^4}+\frac {(a+x)^{4+n}}{b^4}\right ) \, dx,x,b \tan (c+d x)\right )}{b d}\\ &=\frac {\left (a^2+b^2\right )^2 (a+b \tan (c+d x))^{1+n}}{b^5 d (1+n)}-\frac {4 a \left (a^2+b^2\right ) (a+b \tan (c+d x))^{2+n}}{b^5 d (2+n)}+\frac {2 \left (3 a^2+b^2\right ) (a+b \tan (c+d x))^{3+n}}{b^5 d (3+n)}-\frac {4 a (a+b \tan (c+d x))^{4+n}}{b^5 d (4+n)}+\frac {(a+b \tan (c+d x))^{5+n}}{b^5 d (5+n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(377\) vs. \(2(161)=322\).
time = 2.04, size = 377, normalized size = 2.34 \begin {gather*} \frac {\sec ^4(c+d x) \left (9 a^4+33 a^2 b^2+64 b^4+18 a^2 b^2 n+96 b^4 n+3 a^2 b^2 n^2+52 b^4 n^2+12 b^4 n^3+b^4 n^4+2 \left (6 a^4+a^2 b^2 \left (20+9 n+n^2\right )+b^4 \left (24+26 n+9 n^2+n^3\right )\right ) \cos (2 (c+d x))+\left (3 a^4-a^2 b^2 \left (-7+n^2\right )+b^4 \left (8+6 n+n^2\right )\right ) \cos (4 (c+d x))-6 a^3 b \sin (2 (c+d x))-26 a b^3 \sin (2 (c+d x))-6 a^3 b n \sin (2 (c+d x))-40 a b^3 n \sin (2 (c+d x))-16 a b^3 n^2 \sin (2 (c+d x))-2 a b^3 n^3 \sin (2 (c+d x))-3 a^3 b \sin (4 (c+d x))-7 a b^3 \sin (4 (c+d x))-3 a^3 b n \sin (4 (c+d x))-9 a b^3 n \sin (4 (c+d x))-2 a b^3 n^2 \sin (4 (c+d x))\right ) (a+b \tan (c+d x))^{1+n}}{b^5 d (1+n) (2+n) (3+n) (4+n) (5+n)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.39, size = 0, normalized size = 0.00 \[\int \left (\sec ^{6}\left (d x +c \right )\right ) \left (a +b \tan \left (d x +c \right )\right )^{n}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.31, size = 286, normalized size = 1.78 \begin {gather*} \frac {\frac {{\left (b \tan \left (d x + c\right ) + a\right )}^{n + 1}}{b {\left (n + 1\right )}} + \frac {2 \, {\left ({\left (n^{2} + 3 \, n + 2\right )} b^{3} \tan \left (d x + c\right )^{3} + {\left (n^{2} + n\right )} a b^{2} \tan \left (d x + c\right )^{2} - 2 \, a^{2} b n \tan \left (d x + c\right ) + 2 \, a^{3}\right )} {\left (b \tan \left (d x + c\right ) + a\right )}^{n}}{{\left (n^{3} + 6 \, n^{2} + 11 \, n + 6\right )} b^{3}} + \frac {{\left ({\left (n^{4} + 10 \, n^{3} + 35 \, n^{2} + 50 \, n + 24\right )} b^{5} \tan \left (d x + c\right )^{5} + {\left (n^{4} + 6 \, n^{3} + 11 \, n^{2} + 6 \, n\right )} a b^{4} \tan \left (d x + c\right )^{4} - 4 \, {\left (n^{3} + 3 \, n^{2} + 2 \, n\right )} a^{2} b^{3} \tan \left (d x + c\right )^{3} + 12 \, {\left (n^{2} + n\right )} a^{3} b^{2} \tan \left (d x + c\right )^{2} - 24 \, a^{4} b n \tan \left (d x + c\right ) + 24 \, a^{5}\right )} {\left (b \tan \left (d x + c\right ) + a\right )}^{n}}{{\left (n^{5} + 15 \, n^{4} + 85 \, n^{3} + 225 \, n^{2} + 274 \, n + 120\right )} b^{5}}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 420 vs.
\(2 (161) = 322\).
time = 0.42, size = 420, normalized size = 2.61 \begin {gather*} \frac {{\left (8 \, {\left (3 \, a^{5} + 10 \, a^{3} b^{2} + 15 \, a b^{4} - {\left (a^{3} b^{2} - 3 \, a b^{4}\right )} n^{2} + 3 \, {\left (a^{3} b^{2} + 5 \, a b^{4}\right )} n\right )} \cos \left (d x + c\right )^{5} + 4 \, {\left (2 \, a b^{4} n^{3} + 3 \, {\left (a^{3} b^{2} + 3 \, a b^{4}\right )} n^{2} + {\left (3 \, a^{3} b^{2} + 7 \, a b^{4}\right )} n\right )} \cos \left (d x + c\right )^{3} + {\left (a b^{4} n^{4} + 6 \, a b^{4} n^{3} + 11 \, a b^{4} n^{2} + 6 \, a b^{4} n\right )} \cos \left (d x + c\right ) + {\left (b^{5} n^{4} + 10 \, b^{5} n^{3} + 35 \, b^{5} n^{2} + 50 \, b^{5} n + 24 \, b^{5} + 8 \, {\left (8 \, b^{5} - {\left (3 \, a^{2} b^{3} - b^{5}\right )} n^{2} - 3 \, {\left (a^{4} b + 3 \, a^{2} b^{3} - 2 \, b^{5}\right )} n\right )} \cos \left (d x + c\right )^{4} + 4 \, {\left (8 \, b^{5} - {\left (a^{2} b^{3} - b^{5}\right )} n^{3} - {\left (3 \, a^{2} b^{3} - 7 \, b^{5}\right )} n^{2} - 2 \, {\left (a^{2} b^{3} - 7 \, b^{5}\right )} n\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )\right )} \left (\frac {a \cos \left (d x + c\right ) + b \sin \left (d x + c\right )}{\cos \left (d x + c\right )}\right )^{n}}{{\left (b^{5} d n^{5} + 15 \, b^{5} d n^{4} + 85 \, b^{5} d n^{3} + 225 \, b^{5} d n^{2} + 274 \, b^{5} d n + 120 \, b^{5} d\right )} \cos \left (d x + c\right )^{5}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}^n}{{\cos \left (c+d\,x\right )}^6} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________